<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
    <!-- Reset Stylesheet -->
    <link rel="stylesheet" href="/back/css/reset.css" type="text/css"
          media="screen" />
    <!-- Main Stylesheet -->
    <link rel="stylesheet" href="/back/css/style.css" type="text/css"
          media="screen" />
    <link rel="stylesheet" href="/back/css/invalid.css" type="text/css"
          media="screen" />

    <!--                       Javascripts                       -->
    <!-- jQuery -->
    <script type="text/javascript"
            src="/back/scripts/jquery-2.1.0.min.js"></script>
    <!-- jQuery Configuration -->
    <script type="text/javascript"
            src="/back/scripts/simpla.jquery.configuration.js"></script>

    <!-- dialog弹出框的导入-->
    <link rel="stylesheet" href="/back/widget/dialog/jquery-ui.min.css"/>
    <script type="text/javascript" src="/back/widget/dialog/jquery-ui-1.9.2.custom.min.js"></script>
    <script type="application/javascript" src="/commons/js/mydialog.js"></script>

    <!--引入webuploader-->
    <link rel="stylesheet" type="text/css" href="/back/widget/webuploader/webuploader.css">
    <script type="text/javascript" src="/back/widget/webuploader/webuploader.min.js"></script>
    <script type="text/javascript" src="/commons/js/myupload.js"></script>

    <!-- 引入ajax -->
    <script type="text/javascript" src="/commons/js/myajax.js"></script>

    <script th:inline="javascript">
        $(function () {
            //初始化上传插件
            uploadInit();

            //查询列表
            list({
                url: '/api/language/list',
                delUrl: '/api/language/remove',
                cols: [{col:"id"}, {col:"languageFlag", type:"img", width:60, height:50}, {col:"languageName"}, {col:"languageCode"}]
            });
        });

    </script>
</head>
<body>
<div id="main-content">
    <div class="content-box">
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <h2>语言管理</h2>
            <br/>
            <div class="tab-content default-tab" id="tab1">
                <form id="formid" method="post">
                    <table>
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>国旗</th>
                            <th>语言名称</th>
                            <th>语言编码</th>
                            <th>操作</th>
                        </tr>
                        </thead>

                        <tbody>
                        </tbody>

                        <!-- 脚部 -->
                        <tfoot>
                            <tr>
                                <td colspan="6">
                                    <div class="bulk-actions align-left">
                                        <a class="mybutton" href="javascript:openDialog('dialog_add', '新增语言');">新增语言</a>
                                    </div>
                                    <!-- 分页导航 -->
        <!--                            <div class="pagination" th:replace="backs/page :: fenye">-->
        <!--                            </div> &lt;!&ndash; End .pagination &ndash;&gt;-->
                                    <div class="clear"></div>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </form>
            </div>
        </div>
        <!-- End .content-box-content -->
    </div>
</div>
<!-- End #main-content -->
<div id="dialog_add" style="display: none;">

        <!-- End .content-box-header -->
        <div class="content-box-content">
            <h2>新增语言</h2>

            <form id="myform">
                <p>
                    国旗：
                </p>
                <p>
                    <a id="picker">文件上传</a> <div id="upload_list"></div>
                    <input type="hidden" id="file_path" name="languageFlag"/>
                </p>
                <p>
                    语言名称：
                </p>
                <p>
                    <input
                            class="text-input large-input" type="text"
                            name="languageName" placeholder="请输入语言名称（比如：中文（简体））"/>
                </p>
                <p>
                    语言编码：
                </p>
                <p>
                    <input
                            class="text-input large-input" type="text"
                            name="languageCode" placeholder="请输入语言编码（比如：zh_CN）"/>
                </p>
                <p>
                    <button type="button" class="mybutton" onclick="insert('myform', '/api/language/save');">保存</button>
                    <button type="reset" class="mybutton">重置</button>
                </p>
            </form>
        </div>
        <!-- End .content-box-content -->

</div>
</body>
</html>